package com.xiaoqiang.commons.base.status;

import lombok.Getter;

@Getter
public enum BaseDataStatusEnums implements Status
{
    NORMAL(1, "正常"),
    EXPIRE(2, "已过期"),
    DELETED(-1, "已删除");

    int code;
    String description;

    BaseDataStatusEnums(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public static BaseDataStatusEnums getStatus(String value)
    {
        for (BaseDataStatusEnums WBaseDataStatusEnums : values())
        {
            if (WBaseDataStatusEnums.toString().equals(value))
            {
                return WBaseDataStatusEnums;
            }
        }
        throw new RuntimeException("Illegal status!");
    }
}
